<?php
   if( !isset( $module ) ) $module = '';
   if( !isset( $action ) ) $action = '';
?>
<div id="menu">
    <ul>
        <li><a href="#home">Panel</a></li>
        <li><a href="#configuration">Configuration</a></li>
        <li><a href="#contents">Contents</a></li>
    </ul>
    <div id="home">
        Bienvenue, vous êtes sur le module: <?php echo $module ?>, et l'action: <?php echo $action ?> <br />
        <?php echo HtmlHelper::linkTo( 'Accueil', UriHelper::get() );?>
    </div>
    <div id="configuration">
        <ul class="subNav">
            <li>
                <?php echo HtmlHelper::linkTo( 'Les roles' , UriHelper::get( BackendModulesList::ROLES ), $module == BackendModulesList::ROLES ? array( 'class' => 'active' ) : array() );?>
            </li>
        </ul>
    </div>
    <div id="contents">
        <ul class="subNav">
            <li>
                <?php echo HtmlHelper::linkTo( 'Les médias', UriHelper::get( BackendModulesList::MEDIA ), $module == BackendModulesList::MEDIA ? array( 'class' => 'active' ) : array() );?>
            </li>
        </ul>
    </div>
</div>
<?php
  $tabs = array( 'home' => 0, 'configuration' => 1, 'contents' => 2 );
  if( in_array( $module, array( BackendModulesList::ROLES ) ) ):
    $tabSelected = $tabs['configuration'];
  elseif( in_array( $module, array( BackendModulesList::MEDIA ) ) ):
    $tabSelected = $tabs['contents'];
  else:
    $tabSelected = $tabs['home'];
  endif;
?>

<script type="text/javascript">
  (function($) {
    $(document).ready(function(){
      $("#menu").tabs({ selected: <?php echo $tabSelected ?> });
    });
  })(jQuery);
</script>